package com.riteny.paymentgateway.swifypass.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.dom4j.Element;

/**
 * @author Riteny
 * 2021/7/1  10:32
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SwiftPassSubmitPaymentOrderResponseEntity {

    public SwiftPassSubmitPaymentOrderResponseEntity(Element responseXml) {
        setVersion(responseXml.elementText("version"));
        setCharset(responseXml.elementText("charset"));
        setSignType(responseXml.elementText("sign_type"));
        setStatus(responseXml.elementText("status"));
        setMessage(responseXml.elementText("message"));
        setResultCode(responseXml.elementText("result_code"));
        setMchId(responseXml.elementText("mch_id"));
        setDeviceInfo(responseXml.elementText("device_info"));
        setNonceStr(responseXml.elementText("nonce_str"));
        setTransactionId(responseXml.elementText("transaction_id"));
        setOutTradeNo(responseXml.elementText("out_trade_no"));
        setService(responseXml.elementText("service"));
        setErrCode(responseXml.elementText("err_code"));
        setErrMsg(responseXml.elementText("err_msg"));
        setSign(responseXml.elementText("sign"));

        //支付寶參數
        setPayInfo(responseXml.elementText("pay_info"));


    }

    private String version;

    private String charset;

    private String signType;

    private String status;

    private String message;

    private String resultCode;

    private String mchId;

    private String deviceInfo;

    private String nonceStr;

    private String transactionId;

    private String outTradeNo;

    private String service;

    private String errCode;

    private String errMsg;

    private String sign;

    private String payInfo;
}
